package com.woniuxy.main.mapper;

import com.woniuxy.main.pojo.User;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Copyright (C), 2019-9012, sun sss info. Co., Ltd.
 *
 * @author Su
 * @version 1.0
 * InterfaceName: UserMapper
 * Description: 用户实体类持久层接口
 * @date 2019/8/1 12:18
 **/
@Repository
public interface UserMapper {


    /**
     * 查询:所有用户
     *
     * @return 用户集合
     * @throws Exception 全部
     */
    @Select("select * from user")
    List<User> findAll() throws Exception;

    /**
     * 查询:根据id查询用户
     *
     * @param user_id 用户id
     * @return User对象
     * @throws Exception 全部
     */
    @Select("select * from user  where user_id=#{user_id} ")
    User findById(Integer user_id) throws Exception;
}
